# 元组的定义
a = ()
print(type(a))
# (a + b) * c
b = (1)  # 相当于提高运算优先级的小括号
print(type(b))
c = (1, )
print(type(c))
d = (1, 'a', True, ('a', 'b', 'c'))
print(type(d))

e = [4, 5, 6]
f = tuple(e)  # 将列表转换成元组
print(type(e))
print(type(f))

print(f[0])
print(f[-3])
print(f[-3: -1])  # (4, 5)

g = (x for x in range(5))
for temp in g:
    print(temp)